3.235 \(\int \frac{(g+h x) (d+e x+f x^2)}{(a+b x+c x^2)^{3/2}} \, dx\)

Optimal. Leaf size=186 \[ \frac{2 (g+h x) \left (c \left (2 a e-b \left (\frac{a f}{c}+d\right )\right )-x \left (-2 a c f+b^2 f-b c e+2 c^2 d\right )\right )}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}+\frac{h \sqrt{a+b x+c x^2} \left (-8 a c f+3 b^2 f-2 b c e+4 c^2 d\right )}{c^2 \left (b^2-4 a c\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) (3 b f h-2 c (e h+f g))}{2 c^{5/2}} \]

[Out]

(2*(c*(2*a*e - b*(d + (a*f)/c)) - (2*c^2*d - b*c*e + b^2*f - 2*a*c*f)*x)*(g + h*x))/(c*(b^2 - 4*a*c)*Sqrt[a +
b*x + c*x^2]) + ((4*c^2*d - 2*b*c*e + 3*b^2*f - 8*a*c*f)*h*Sqrt[a + b*x + c*x^2])/(c^2*(b^2 - 4*a*c)) - ((3*b*
f*h - 2*c*(f*g + e*h))*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(2*c^(5/2))

________________________________________________________________________________________

Rubi [A]  time = 0.226817, antiderivative size = 186, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {1644, 640, 621, 206} \[ \frac{2 (g+h x) \left (c \left (2 a e-b \left (\frac{a f}{c}+d\right )\right )-x \left (-2 a c f+b^2 f-b c e+2 c^2 d\right )\right )}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}+\frac{h \sqrt{a+b x+c x^2} \left (-8 a c f+3 b^2 f-2 b c e+4 c^2 d\right )}{c^2 \left (b^2-4 a c\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) (3 b f h-2 c (e h+f g))}{2 c^{5/2}} \]

Antiderivative was successfully verified.

[In]

Int[((g + h*x)*(d + e*x + f*x^2))/(a + b*x + c*x^2)^(3/2),x]

[Out]

(2*(c*(2*a*e - b*(d + (a*f)/c)) - (2*c^2*d - b*c*e + b^2*f - 2*a*c*f)*x)*(g + h*x))/(c*(b^2 - 4*a*c)*Sqrt[a +
b*x + c*x^2]) + ((4*c^2*d - 2*b*c*e + 3*b^2*f - 8*a*c*f)*h*Sqrt[a + b*x + c*x^2])/(c^2*(b^2 - 4*a*c)) - ((3*b*
f*h - 2*c*(f*g + e*h))*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(2*c^(5/2))

Rule 1644

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomi
alQuotient[Pq, a + b*x + c*x^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x + c*x^2, x], x, 0], g = Coeff[Po
lynomialRemainder[Pq, a + b*x + c*x^2, x], x, 1]}, Simp[((d + e*x)^m*(a + b*x + c*x^2)^(p + 1)*(f*b - 2*a*g +
(2*c*f - b*g)*x))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(d + e*x)^(m - 1)*(a + b*x
 + c*x^2)^(p + 1)*ExpandToSum[(p + 1)*(b^2 - 4*a*c)*(d + e*x)*Q + g*(2*a*e*m + b*d*(2*p + 3)) - f*(b*e*m + 2*c
*d*(2*p + 3)) - e*(2*c*f - b*g)*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && PolyQ[Pq, x] && N
eQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] && (IntegerQ[p] ||  !IntegerQ[m
] ||  !RationalQ[a, b, c, d, e]) &&  !(IGtQ[m, 0] && RationalQ[a, b, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2,
 0]))

Rule 640

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(e*(a + b*x + c*x^2)^(p +
 1))/(2*c*(p + 1)), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{(g+h x) \left (d+e x+f x^2\right )}{\left (a+b x+c x^2\right )^{3/2}} \, dx &=\frac{2 \left (c \left (2 a e-b \left (d+\frac{a f}{c}\right )\right )-\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) x\right ) (g+h x)}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}-\frac{2 \int \frac{-\frac{b^2 f g+2 b (c d+a f) h-4 a c (f g+e h)}{2 c}-\frac{1}{2} \left (4 c d-2 b e-8 a f+\frac{3 b^2 f}{c}\right ) h x}{\sqrt{a+b x+c x^2}} \, dx}{b^2-4 a c}\\ &=\frac{2 \left (c \left (2 a e-b \left (d+\frac{a f}{c}\right )\right )-\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) x\right ) (g+h x)}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}+\frac{\left (4 c^2 d+3 b^2 f-2 c (b e+4 a f)\right ) h \sqrt{a+b x+c x^2}}{c^2 \left (b^2-4 a c\right )}-\frac{(3 b f h-2 c (f g+e h)) \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx}{2 c^2}\\ &=\frac{2 \left (c \left (2 a e-b \left (d+\frac{a f}{c}\right )\right )-\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) x\right ) (g+h x)}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}+\frac{\left (4 c^2 d+3 b^2 f-2 c (b e+4 a f)\right ) h \sqrt{a+b x+c x^2}}{c^2 \left (b^2-4 a c\right )}-\frac{(3 b f h-2 c (f g+e h)) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )}{c^2}\\ &=\frac{2 \left (c \left (2 a e-b \left (d+\frac{a f}{c}\right )\right )-\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) x\right ) (g+h x)}{c \left (b^2-4 a c\right ) \sqrt{a+b x+c x^2}}+\frac{\left (4 c^2 d+3 b^2 f-2 c (b e+4 a f)\right ) h \sqrt{a+b x+c x^2}}{c^2 \left (b^2-4 a c\right )}-\frac{(3 b f h-2 c (f g+e h)) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{2 c^{5/2}}\\ \end{align*}

Mathematica [A]  time = 0.780652, size = 205, normalized size = 1.1 \[ \frac{\frac{2 \sqrt{c} \left (4 c \left (2 a^2 f h-a c (d h+e (g+h x)+f x (g-h x))+c^2 d g x\right )+b^2 (c x (2 e h+2 f g-f h x)-3 a f h)+2 b c (a e h+a f (g+5 h x)+c d (g-h x)-c e g x)-3 b^3 f h x\right )}{\sqrt{a+x (b+c x)}}+\left (b^2-4 a c\right ) \log \left (2 \sqrt{c} \sqrt{a+x (b+c x)}+b+2 c x\right ) (3 b f h-2 c (e h+f g))}{2 c^{5/2} \left (4 a c-b^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[((g + h*x)*(d + e*x + f*x^2))/(a + b*x + c*x^2)^(3/2),x]

[Out]

((2*Sqrt[c]*(-3*b^3*f*h*x + 2*b*c*(a*e*h - c*e*g*x + c*d*(g - h*x) + a*f*(g + 5*h*x)) + b^2*(-3*a*f*h + c*x*(2
*f*g + 2*e*h - f*h*x)) + 4*c*(2*a^2*f*h + c^2*d*g*x - a*c*(d*h + f*x*(g - h*x) + e*(g + h*x)))))/Sqrt[a + x*(b
 + c*x)] + (b^2 - 4*a*c)*(3*b*f*h - 2*c*(f*g + e*h))*Log[b + 2*c*x + 2*Sqrt[c]*Sqrt[a + x*(b + c*x)]])/(2*c^(5
/2)*(-b^2 + 4*a*c))

________________________________________________________________________________________

Maple [B]  time = 0.057, size = 735, normalized size = 4. \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(3/2),x)

[Out]

1/2*b^3/c^2/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*e*h-b^2/c/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*e*g+b^2/c/(4*a*c-b^2)/(c
*x^2+b*x+a)^(1/2)*x*e*h-x/c/(c*x^2+b*x+a)^(1/2)*e*h-x/c/(c*x^2+b*x+a)^(1/2)*f*g+4*h*f*a/c*b/(4*a*c-b^2)/(c*x^2
+b*x+a)^(1/2)*x+2*h*f*a/c^2*b^2/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)+b^2/c/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*x*f*g-3/
2*h*f*b^3/c^2/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*x-3/4*h*f*b^2/c^3/(c*x^2+b*x+a)^(1/2)+h*f*x^2/c/(c*x^2+b*x+a)^(1
/2)+1/2*b/c^2/(c*x^2+b*x+a)^(1/2)*f*g+1/2*b/c^2/(c*x^2+b*x+a)^(1/2)*e*h-3/2*h*f*b/c^(5/2)*ln((1/2*b+c*x)/c^(1/
2)+(c*x^2+b*x+a)^(1/2))+2*h*f*a/c^2/(c*x^2+b*x+a)^(1/2)+2*d*g*(2*c*x+b)/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)-2*b/(4
*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*x*d*h-2*b/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*x*e*g+1/2*b^3/c^2/(4*a*c-b^2)/(c*x^2+b
*x+a)^(1/2)*f*g-1/c/(c*x^2+b*x+a)^(1/2)*d*h-1/c/(c*x^2+b*x+a)^(1/2)*e*g+1/c^(3/2)*ln((1/2*b+c*x)/c^(1/2)+(c*x^
2+b*x+a)^(1/2))*e*h+1/c^(3/2)*ln((1/2*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))*f*g-3/4*h*f*b^4/c^3/(4*a*c-b^2)/(c*x
^2+b*x+a)^(1/2)+3/2*h*f*b/c^2*x/(c*x^2+b*x+a)^(1/2)-b^2/c/(4*a*c-b^2)/(c*x^2+b*x+a)^(1/2)*d*h

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(3/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 53.4317, size = 1939, normalized size = 10.42 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(3/2),x, algorithm="fricas")

[Out]

[-1/4*((2*(a*b^2*c - 4*a^2*c^2)*f*g + (2*(b^2*c^2 - 4*a*c^3)*f*g + (2*(b^2*c^2 - 4*a*c^3)*e - 3*(b^3*c - 4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(2*(2*c^4*d - b*c^3*e + (b^2*c^2 - 2*a*c^3)*f)*g - (2*b*c^3*d - 2*(b^2*c^2 - 2*a*c^3)*e + (3*b^3*c - 10*a*b*c
^2)*f)*h)*x)*sqrt(c*x^2 + b*x + a))/(a*b^2*c^3 - 4*a^2*c^4 + (b^2*c^4 - 4*a*c^5)*x^2 + (b^3*c^3 - 4*a*b*c^4)*x
)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (g + h x\right ) \left (d + e x + f x^{2}\right )}{\left (a + b x + c x^{2}\right )^{\frac{3}{2}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x**2+e*x+d)/(c*x**2+b*x+a)**(3/2),x)

[Out]

Integral((g + h*x)*(d + e*x + f*x**2)/(a + b*x + c*x**2)**(3/2), x)

________________________________________________________________________________________

Giac [A]  time = 1.22159, size = 366, normalized size = 1.97 \begin{align*} \frac{{\left (\frac{{\left (b^{2} c f h - 4 \, a c^{2} f h\right )} x}{b^{2} c^{2} - 4 \, a c^{3}} - \frac{4 \, c^{3} d g + 2 \, b^{2} c f g - 4 \, a c^{2} f g - 2 \, b c^{2} d h - 3 \, b^{3} f h + 10 \, a b c f h - 2 \, b c^{2} g e + 2 \, b^{2} c h e - 4 \, a c^{2} h e}{b^{2} c^{2} - 4 \, a c^{3}}\right )} x - \frac{2 \, b c^{2} d g + 2 \, a b c f g - 4 \, a c^{2} d h - 3 \, a b^{2} f h + 8 \, a^{2} c f h - 4 \, a c^{2} g e + 2 \, a b c h e}{b^{2} c^{2} - 4 \, a c^{3}}}{\sqrt{c x^{2} + b x + a}} - \frac{{\left (2 \, c f g - 3 \, b f h + 2 \, c h e\right )} \log \left ({\left | -2 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} \sqrt{c} - b \right |}\right )}{2 \, c^{\frac{5}{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(3/2),x, algorithm="giac")

[Out]

(((b^2*c*f*h - 4*a*c^2*f*h)*x/(b^2*c^2 - 4*a*c^3) - (4*c^3*d*g + 2*b^2*c*f*g - 4*a*c^2*f*g - 2*b*c^2*d*h - 3*b
^3*f*h + 10*a*b*c*f*h - 2*b*c^2*g*e + 2*b^2*c*h*e - 4*a*c^2*h*e)/(b^2*c^2 - 4*a*c^3))*x - (2*b*c^2*d*g + 2*a*b
*c*f*g - 4*a*c^2*d*h - 3*a*b^2*f*h + 8*a^2*c*f*h - 4*a*c^2*g*e + 2*a*b*c*h*e)/(b^2*c^2 - 4*a*c^3))/sqrt(c*x^2
+ b*x + a) - 1/2*(2*c*f*g - 3*b*f*h + 2*c*h*e)*log(abs(-2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*sqrt(c) - b))/c^
(5/2)